<script lang="ts" setup>
	import { ref } from "vue";
	import {
		validatePhoneNumber
	} from '@/utlis/common.js'
	import {
		onShow,
		onHide,
		onLoad
	} from '@dcloudio/uni-app'
	import {
		getCurrentInstance
	} from 'vue'
	import {
		useRouter
	} from 'uni-mini-router'
	import {
		userStore
	} from '@/pinia';
	import { json } from "node:stream/consumers";
	const userStoreInfo = userStore();
	let router = useRouter()
	const {
		proxy,
	} = getCurrentInstance()
	let listId = ref()
	onLoad((options) => {
		//参数id,用来请求服务类型得父级id
		console.log(options);
		if (options.id) {
			getScreen(options.id)
			formArr.value = kongfangArr.value
			form.value = kongfang.value
			rules.value = kongfangRules
		} else {
			listId.value = options.listId
			getDetail(options.listId)
		}
	})
	const getDetail = (id) => {
		//获取详情回显并且判断是那个类型的表单
		proxy.$req('GET', proxy.$api.queryZhuanrangDetail, {
			id,
		}).then((res) => {
			console.log(res);
			if (!res.success) {
				return
			}
			typeList.value = res.result.serviceCenterList
			let dataA = res.result.roomTransfer
			if (res.result.roomTransfer.serviceId == '21') {
				//空房回显

				formArr.value = kongfangArr.value
				form.value = kongfang.value
				rules.value = kongfangRules.value
				form.value.title = dataA.title
				form.value.yajin = dataA.depositMoney.toString()
				form.value.fangzu = dataA.roomZujin
				form.value.mianji = dataA.roomArea.toString()
				form.value.busStatus = dataA.storeStatus
				form.value.roomNum = dataA.roomNum.toString()
				form.value.busType = dataA.storeType
				form.value.isDone = dataA.isSettle
				form.value.aroundBus = dataA.storeRound
				province.value = dataA.province
				city.value = dataA.city
				area.value = dataA.area
				form.value.human = dataA.contactUser
				form.value.phone = dataA.contactPhone
				fileList.value.fileList0 = JSON.parse(dataA.images)
				form.value.address = dataA.address

				form.value.type = res.result.serviceCenterList[0].name
				form.value.typeId = res.result.serviceCenterList[0].id
			} else if (res.result.roomTransfer.serviceId == '22') {
				//仪器回显

				formArr.value = yiqiArr.value
				form.value = yiqi.value
				rules.value = yiqiRules.value

				form.value.title = dataA.title
				form.value.jiage = dataA.price.toString()
				form.value.yiqiType = dataA.deviceType
				form.value.newOld = dataA.newOldStatus
				form.value.howYear = dataA.yearNum.toString()
				form.value.busStatus = dataA.storeStatus
				province.value = dataA.province
				city.value = dataA.city
				area.value = dataA.area
				form.value.human = dataA.contactUser
				form.value.phone = dataA.contactPhone
				fileList.value.fileList0 = JSON.parse(dataA.images)
				form.value.address = dataA.address

				form.value.type = res.result.serviceCenterList[1].name
				form.value.typeId = res.result.serviceCenterList[1].id
			} else if (res.result.roomTransfer.serviceId == '23') {
				//整店回显
				formArr.value = zhengdianArr.value
				form.value = zhengdian.value
				rules.value = zhengdianRules.value

				form.value.title = dataA.title
				form.value.yajin = dataA.depositMoney.toString()
				form.value.fangzu = dataA.roomZujin.toString()
				form.value.mianji = dataA.roomArea.toString()
				form.value.busStatus = dataA.storeStatus
				form.value.roomNum = dataA.roomNum.toString()
				form.value.busType = dataA.storeType
				form.value.isDone = dataA.isSettle
				form.value.aroundBus = dataA.storeRound
				form.value.vipNum = dataA.vipNum
				form.value.workTool = dataA.workDevice
				form.value.yiqiNum = dataA.deviceNum.toString()
				form.value.workerNum = dataA.staffNum.toString()
				form.value.newOld = dataA.newOldStatus
				province.value = dataA.province
				city.value = dataA.city
				area.value = dataA.area
				form.value.human = dataA.contactUser
				form.value.phone = dataA.contactPhone
				fileList.value.fileList0 = JSON.parse(dataA.images)
				form.value.address = dataA.address

				form.value.type = res.result.serviceCenterList[2].name
				form.value.typeId = res.result.serviceCenterList[2].id
			}
			getAllFormItemScreen()
		})
	}
	//空房
	let kongfang = ref({
		type: '',
		typeId: '',
		title: '',
		yajin: '',
		fangzu: '',
		mianji: '',
		busStatus: '',
		roomNum: '',
		busType: '',
		isDone: '',
		aroundBus: '',
		address: '',
		human: '',
		phone: ''
	})
	let kongfangRules = ref({
		type: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		title: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		yajin: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		fangzu: {
			type: 'number',
			required: true,
			message: '房租不正确',
			trigger: ['change']
		},
		mianji: {
			type: 'number',
			required: true,
			message: '面积不正确',
			trigger: ['change']
		},
		busStatus: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		roomNum: {
			type: 'number',
			required: true,
			message: '房间数量为数字',
			trigger: ['change']
		},
		busType: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		isDone: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		aroundBus: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		address: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		human: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		phone: [{
			required: true,
			message: '手机号码必填',
		},
		{
			validator: (rule, value, callback) => {
				return validatePhoneNumber(value);
			},
			message: '手机号码不正确',
			trigger: ['change'],
		}],
	})
	let kongfangArr = ref([
		{
			label: '标题',
			key: 'title',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '押金',
			key: 'yajin',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '房租（元）',
			key: 'fangzu',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '面积（平方米）',
			key: 'mianji',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '店铺状态',
			key: 'busStatus',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '房间数量（个）',
			key: 'roomNum',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '店铺类型',
			key: 'busType',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '物业是否结清',
			key: 'isDone',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '周围商圈',
			key: 'aroundBus',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '公司地址',
			key: 'address',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '联系人',
			key: 'human',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '手机号',
			key: 'phone',
			isSelect: false,
			selectOptions: [],
		}
	])
	//仪器
	let yiqi = ref({
		type: '',
		typeId: '',
		title: '',
		jiage: '',
		yiqiType: '',
		newOld: '',
		howYear: '',
		busStatus: '',
		address: '',
		human: '',
		phone: ''
	})
	let yiqiRules = ref({
		type: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		title: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		jiage: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		yiqiType: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		newOld: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		howYear: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		busStatus: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		address: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		human: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		phone: [{
			required: true,
			message: '手机号码必填',
		},
		{
			validator: (rule, value, callback) => {
				console.log(value);
				return validatePhoneNumber(value);
			},
			message: '手机号码不正确',
			trigger: ['change'],
		}],
	})
	let yiqiArr = ref([
		{
			label: '标题',
			key: 'title',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '价格（元）',
			key: 'jiage',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '仪器类型',
			key: 'yiqiType',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '新旧程度',
			key: 'newOld',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '使用年限（年）',
			key: 'howYear',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '店铺状态',
			key: 'busStatus',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '地址',
			key: 'address',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '联系人',
			key: 'human',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '手机号',
			key: 'phone',
			isSelect: false,
			selectOptions: [],
		}
	])
	//整店
	let zhengdian = ref({
		type: '',
		typeId: '',
		title: '',
		yajin: '',
		fangzu: '',
		mianji: '',
		busStatus: '',
		roomNum: '',
		busType: '',
		isDone: '',
		aroundBus: '',
		vipNum: '',
		workTool: '',
		yiqiNum: '',
		workerNum: '',
		newOld: '',
		address: '',
		human: '',
		phone: ''
	})
	let zhengdianRules = ref({
		type: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		title: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		yajin: {
			required: true,
			min: 1,
			max: 7,
			message: '请输入正确内容',
			trigger: ['change']
		},
		fangzu: {
			required: true,
			min: 1,
			max: 7,
			message: '请输入正确内容',
			trigger: ['change']
		},
		mianji: {
			required: true,
			min: 1,
			max: 5,
			message: '请输入正确内容',
			trigger: ['change']
		},
		busStatus: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		roomNum: {
			required: true,
			min: 1,
			max: 3,
			message: '请输入正确内容',
			trigger: ['change']
		},
		busType: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		isDone: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		aroundBus: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		vipNum: {
			required: true,
			min: 1,
			max: 6,
			message: '请输入正确内容',
			trigger: ['change']
		},
		workTool: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		yiqiNum: {
			required: true,
			min: 1,
			max: 4,
			message: '请输入正确内容',
			trigger: ['change']
		},
		workerNum: {
			required: true,
			min: 1,
			max: 4,
			message: '请输入正确内容',
			trigger: ['change']
		},
		newOld: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		address: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		human: {
			required: true,
			message: '请输入正确内容',
			trigger: ['change']
		},
		phone: [{
			required: true,
			message: '手机号码必填',
		},
		{
			validator: (rule, value, callback) => {
				console.log(value);
				return validatePhoneNumber(value);
			},
			message: '手机号码不正确',
			trigger: ['change'],
		}],
	})
	let zhengdianArr = ref([
		{
			label: '标题',
			key: 'title',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '押金',
			key: 'yajin',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '房租（元）',
			key: 'fangzu',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '面积（平方米）',
			key: 'mianji',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '商户状态',
			key: 'busStatus',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '房间数量（个）',
			key: 'roomNum',
			isSelect: false,
			selectOptions: [],
		},

		{
			label: '商户类型',
			key: 'busType',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '物业交接情况',
			key: 'isDone',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '周围商圈',
			key: 'aroundBus',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '会员数（人）',
			key: 'vipNum',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '办公设备',
			key: 'workTool',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '仪器数量（台）',
			key: 'yiqiNum',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '现有员工（人）',
			key: 'workerNum',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '仪器设备新旧程度',
			key: 'newOld',
			isSelect: true,
			selectOptions: [],
		},
		{
			label: '地址',
			key: 'address',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '联系人',
			key: 'human',
			isSelect: false,
			selectOptions: [],
		},
		{
			label: '手机号',
			key: 'phone',
			isSelect: false,
			selectOptions: [],
		}
	])
	//绑定的表单数据，，，上面是模拟好的数据
	let form = ref({})
	let formArr = ref([])
	let rules = ref({})
	let typeList = ref([])
	//methods
	const getScreen = (id) => {
		// 获取服务类型（表单类型）
		proxy.$req('GET', proxy.$api.localService, {
			id,
		}).then((res) => {
			// console.log(res, 'res');
			typeList.value = res.result
			form.value.type = res.result[0].name
			form.value.typeId = res.result[0].id
			getAllFormItemScreen()
		})
	}
	const typeChose = () => {
		//选择表单类型
		let arr = typeList.value.map((item) => {
			return item.name
		})
		// console.log(marketType.value);
		uni.showActionSheet({
			itemList: arr,
			success: function (res) {
				console.log(res.tapIndex);
				if (res.tapIndex == 0) {
					formArr.value = kongfangArr.value
					form.value = kongfang.value
					rules.value = kongfangRules.value
				} else if (res.tapIndex == 1) {
					formArr.value = yiqiArr.value
					form.value = yiqi.value
					rules.value = yiqiRules.value
				} else if (res.tapIndex == 2) {
					formArr.value = zhengdianArr.value
					form.value = zhengdian.value
					rules.value = zhengdianRules.value
				}
				form.value.type = arr[res.tapIndex]
				form.value.typeId = typeList.value[res.tapIndex].id
				getAllFormItemScreen()
			},
			fail: function (res) {
				// console.log(res.errMsg);
			}
		});
	}
	const showAction = (item) => {
		//需要选择得表单项，选择，并且推送到对应得表
		if (!item.isSelect) return
		if (item.key == 'address') {
			// console.log('dizhi');
			return
		}
		//拿到item,push到哪个form项里
		let arr = item.selectOptions.map((item) => {
			return item.value
		})
		uni.showActionSheet({
			itemList: arr,
			success: function (res) {
				form.value[item.key] = item.selectOptions[res.tapIndex].value
				console.log(form.value[item.key]);
				// console.log(item.selectOptions[res.tapIndex]);


			},
			fail: function (res) {

			}
		});
	}
	let formRef = ref(null)
	const submitForm = () => {
		if (fileList.value.fileList0.length <= 0) {
			uni.showToast({
				title: '请上传图片',
				icon: 'none'
			})
			return
		}
		let data;
		if (form.value.typeId == '21') {
			//空房
			data = {
				id: listId.value ? listId.value : '',
				title: form.value.title,
				depositMoney: form.value.yajin,
				roomZujin: form.value.fangzu,
				roomArea: form.value.mianji,
				storeStatus: form.value.busStatus,
				roomNum: form.value.roomNum,
				storeType: form.value.busType,
				isSettle: form.value.isDone,
				storeRound: form.value.aroundBus,
				province: province.value,
				city: city.value,
				area: area.value,
				contactUser: form.value.human,
				contactPhone: form.value.phone,

			}
		} else if (form.value.typeId == '22') {
			//仪器设备
			data = {
				id: listId.value ? listId.value : '',
				title: form.value.title,
				price: form.value.jiage,
				deviceType: form.value.yiqiType,
				newOldStatus: form.value.newOld,
				yearNum: form.value.howYear,
				storeStatus: form.value.busStatus,
				province: province.value,
				city: city.value,
				area: area.value,
				contactUser: form.value.human,
				contactPhone: form.value.phone,
			}
		} else if (form.value.typeId == '23') {
			//整店
			data = {
				id: listId.value ? listId.value : '',
				title: form.value.title,
				depositMoney: form.value.yajin,
				roomZujin: form.value.fangzu,
				roomArea: form.value.mianji,
				storeStatus: form.value.busStatus,
				roomNum: form.value.roomNum,
				storeType: form.value.busType,
				isSettle: form.value.isDone,
				storeRound: form.value.aroundBus,
				vipNum: form.value.vipNum,
				workDevice: form.value.workTool,
				deviceNum: form.value.yiqiNum,
				staffNum: form.value.workerNum,
				newOldStatus: form.value.newOld,
				province: province.value,
				city: city.value,
				area: area.value,
				contactUser: form.value.human,
				contactPhone: form.value.phone,
			}
		}
		Object.assign(data, {
			serviceId: form.value.typeId,
			memberId: userStoreInfo.userInfo.id,
			images: JSON.stringify(fileList.value.fileList0),
			address: form.value.address,
		})
		// formRef.value.clearValidate()
		formRef.value.validate().then(res => {
			// console.log(res);
			let url;
			if (listId.value) {
				url = proxy.$api.busZhuanRangEdit
			} else {
				url = proxy.$api.busZhuanRangPublish
			}
			proxy.$req('POST', url, data).then((res) => {
				console.log(res, 'ressubmit');
				uni.showToast({
					title: res.message,
					icon: 'none'
				})
				setTimeout(() => {
					uni.$emit('serviceRefash')
					uni.navigateBack()
				}, 500)
			})
		})
	}
	const getAllFormItemScreen = () => {
		//分配每个表单的筛选项
		proxy.$req('GET', proxy.$api.busZhuanRangScreen, {}).then((res) => {
			console.log(res, 'res');
			if (form.value.typeId == '21') {
				//空房
				formArr.value[1].selectOptions = res.result.yajinList
				formArr.value[4].selectOptions = res.result.storeStatusList
				formArr.value[6].selectOptions = res.result.storeTypeList
				formArr.value[7].selectOptions = res.result.serviceWuyefeiStatusList
				formArr.value[8].selectOptions = res.result.zhouweishangquanList
			} else if (form.value.typeId == '22') {
				//仪器设备
				formArr.value[2].selectOptions = res.result.serviceDeviceTypeList
				formArr.value[3].selectOptions = res.result.serviceNewOldList
				formArr.value[5].selectOptions = res.result.storeStatusList
			} else if (form.value.typeId == '23') {
				//整店
				formArr.value[1].selectOptions = res.result.yajinList
				formArr.value[4].selectOptions = res.result.storeStatusList
				formArr.value[6].selectOptions = res.result.storeTypeList
				formArr.value[7].selectOptions = res.result.serviceWuyefeiStatusList
				formArr.value[8].selectOptions = res.result.zhouweishangquanList
				formArr.value[13].selectOptions = res.result.serviceNewOldList
			}
		})
	}
	let province = ref()
	let city = ref()
	let area = ref()
	const addressChecked = (e) => {
		province.value = e.detail.value[0].value
		city.value = e.detail.value[1].value
		area.value = e.detail.value[2].value
		form.value.address = ''
		e.detail.value.map((item) =>
			form.value.address += item.value
		)
		// console.log(form.value.address);
	}
	import cityList from '@/sheng_shi_xian_data.json'
	//图片列表
	let fileList = ref({
		fileList0: [],
	})
	//上传图片
	const afterRead = (e, type) => {
		// console.log(fileList.value[`fileList${type}`], 'fileList[type]');
		// [`fileList${type}`]
		console.log(e);
		const item = e.file;
		// fileList.value[`fileList${type}`].push({
		// 	...item,
		// 	//提示上传中
		// 	status: 'uploading',
		// 	message: '上传中'
		// });
		uni.showLoading({
			title: '上传中',
		})
		for (let a = 0; a <= item.length; a++) {
			uni.uploadFile({
				url: proxy.$uploadUrl + proxy.$api.uploadFile,
				filePath: item[a].url,
				name: 'file',
				formData: {
					file: item[a].url,
				},
				success: (uploadFileRes) => {
					console.log(JSON.parse(uploadFileRes.data));
					if (!JSON.parse(uploadFileRes.data).success) {
						uni.showToast({
							title: JSON.parse(uploadFileRes.data).message,
							icon: 'none'
						})
						// setTimeout(() => {
						// 	fileList.value[`fileList${type}`].splice(-1)
						// }, 700)
						return
					}
					let result = JSON.parse(uploadFileRes.data).result
					// console.log(result, 'result');
					uni.hideLoading()
					fileList.value[`fileList${type}`].push(
						// item[a]
						Object.assign({}, {
							// status: 'success',
							// message: '上传成功',
							url: result,
							thumb: result
						})
					);
					console.log(fileList.value[`fileList${type}`]);
				},
				complete() { }
			});
		}

	}
	//删除图片
	const deletePic = (e, type) => {
		console.log(e);
		fileList.value[`fileList${type}`].splice(e.index, 1)
	}
	const goAuth = () => {
		router.push({
			name: 'authRole',
			params: {}
		})
	}
</script>
<template>
	<view style="padding:16rpx 32rpx;background-color: #F2E6E7;" class="r-flex-between-center"
		v-if="userStoreInfo.userFlag==2?userStoreInfo.userInfo.supplier.isReal!=1:userStoreInfo.userFlag==1?userStoreInfo.userInfo.shoppingStore.isReal!=1:false">
		<text style="color: #FF6C6C;font-size: 28rpx;font-weight: 600;">企业未认证，认证后可发布营销信息</text>
		<view style="background-color: #FF6B6B;color: #fff;font-size: 22rpx;padding: 10rpx 20rpx;border-radius: 60rpx;"
			@click="goAuth">
			去认证
			<!-- 认证标记qx -->
		</view>
	</view>
	<view class="form">
		<u--form :model="form" :rules="rules" ref="formRef" labelPosition="top" labelWidth="150">
			<u-form-item class="formItem " label="" prop="type" @click.stop="typeChose">
				<template #label>
					<view class="r-flex-between-center">
						<view class="">
							<text>*</text>
							<text>服务类型</text>
						</view>
						<u-icon name="arrow-right"></u-icon>
					</view>
				</template>
				<u--input v-model="form.type" border="none" disabled disabledColor="#fff" placeholder="请输入"></u--input>
			</u-form-item>
			<u-form-item class="formItem" label="缩略图" prop="description">
				<view class="formItemArea">
					<u-upload :fileList="fileList.fileList0" @afterRead="afterRead($event,0)"
						@delete="deletePic($event,0)" name="1" multiple :maxCount="1"></u-upload>
				</view>
			</u-form-item>
			<view class="" v-for="(item,index) in formArr" :key="index" @click.stop="showAction(item)">
				<u-form-item class="formItem" :label="item.label" :prop="item.key"
					:style="item.isSelect?'pointer-events:none':''" v-if="item.key!=='address'">
					<u--input v-model="form[item.key]" border="none" :disabled="item.isSelect" disabledColor="#fff"
						placeholder="请输入"></u--input>
					<u-icon name="arrow-right" v-if="item.isSelect"></u-icon>
				</u-form-item>
				<u-form-item class="formItem" :label="item.label" :prop="item.key" :style="item.isSelect?'':''" v-else>
					<uni-data-picker v-model="form[item.key]" :localdata="cityList" popup-title="请选择" :map="{
						text:'label',
						value:'value'
					}" @change="addressChecked">
						<view>{{ form[item.key]?form[item.key]:'请选择' }}</view>
					</uni-data-picker>
				</u-form-item>
			</view>
		</u--form>
		<view class="gysBtn" @click="submitForm()">
			发布
		</view>
	</view>

</template>
<style lang="scss">
	:deep(.input-value-border) {
		border: none !important;
	}

	.form {
		width: 686rpx;
		margin: 0 auto;

		.formItem {
			border-bottom: 1rpx solid #e7e7e7;

			.formItemArea {
				width: 100%;
			}
		}
	}

	.gysBtn {
		width: 686rpx;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		background: #CB645E;
		border-radius: 10rpx;
		color: #fff;
		margin: 50rpx auto;
	}
</style>